package com.huaqing.games.impl;

import com.huaqing.games.ComputerOperation;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @program: javatrainingfirstweek
 * @Description:
 * @author: Mr.Cheng
 * @date: 2022/4/17 1:13 上午
 */
public class ComputerOperationImpl implements ComputerOperation {
    /**
     * @param num
     * @Description: 根据对战的局数，生成随机数
     * @Param: [num]
     * @return: int[]
     * @Author: Mr.Cheng
     * @Date: 2022/4/17 1:12 上午
     */
    @Override
    public int[] computerRandomGenerate(int num) {
        int[] computer = new int[num];
        for(int i = 0; i < num; i++){
            computer[i] = ThreadLocalRandom.current().nextInt(3);
        }
        return computer;
    }
}
